<header class="navbar navbar-fixed-top">
  <div class="navbar-inner">
    <div class="container">
      <div class="nav-collapse">
        <ul class="nav">
          
          <li class="dropdown active">
            <a href="#" class="dropdown-toggle" data-toggle="dropdown">English <b class="caret"></b></a>
            <ul class="dropdown-menu">
              <li><a href="#">English</a></li>
              <li><a href="#">Español</a></li>
            </ul>
          </li>
        </ul>
        {if $user}
        <ul class="nav pull-right">
          <li {if $active === 'dashboard'}class="active"{/if}><a href="{controllers_url}users/dashboard/"><i class="icon-heart icon-white"></i> Dashboard</a></li>
          {if $campaign}
          <li class="{if $active === 'campaign'}active {/if}dropdown">
            <a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="icon-magnet icon-white"></i> Campaign Actions <b class="caret"></b></a>
            <ul class="dropdown-menu">
              <li><a id="magneto-preview" href="{controllers_url}clients/{$client->slug}/campaigns/{$campaign->id}/?" target="magneto-preview"><i class="icon-eye-open"></i> Preview Campaign</a></li>
              <li class="divider"></li>
              <li><a onclick="if (! show_confirm('Enviaras esta campaña a tus {$client->count_recipients()} contactos. Confirmas esta acción?')) return false;" href="{controllers_url}campaigns/send/{$campaign->id}/"><i class="icon-envelope"></i> <strong>Send Campaign!</strong> ({$client->count_recipients()} emails)</a></li>
              <li class="divider"></li>
              <li><a href="{controllers_url}campaigns/settings/{$campaign->id}/"><i class="icon-cog"></i> Settings</a></li>
              <li><a onclick="if (! show_confirm('Are you sure you want to delete this campaign?')) return false;" href="{controllers_url}campaigns/delete/{$campaign->id}/"><i class="icon-trash"></i> Delete</a></li>
              <script type="text/javascript">
                function show_confirm(message) {
                  return confirm(message);
                }

                setInterval(
                  function() {
                    var preview_href = jQuery("#magneto-preview").attr("href").split("?")[0] + "?";
                    jQuery("#magneto-preview").attr("href",preview_href + (new Date().getTime()));
                  },
                  1000
                );
              </script>
            </ul>
          </li>
          {/if}
          <li {if $active === 'profile'}class="active"{/if}><a href="{controllers_url}users/edit/"><i class="icon-user icon-white"></i> Profile</a></li>
          <li class="divider-vertical"></li>
          <li class="dropdown">
            <a href="#" class="dropdown-toggle" data-toggle="dropdown">{$client->name} <b class="caret"></b></a>
            <ul class="dropdown-menu">
              {foreach from=$user->clients() item="client_chg"}
              <li>
                <a href="{controllers_url}clients/change/{$client_chg->id}/">
                  {if $client->id === $client_chg->id}
                  <strong>{$client_chg->name}</strong>
                  {else}
                  {$client_chg->name}
                  {/if}
                </a>
              </li>
              {/foreach}
            </ul>
          </li>
          <li><a href="{controllers_url}users/logout/"><i class="icon-off icon-white"></i> Logout</a></li>
        </ul>
        {/if}
      </div>
    </div>
  </div>
</header>
<!-- header -->